package com.example.filesystem.util;

import org.springframework.util.DigestUtils;

/**
 * @author bbyh
 * @since 2025-04-27
 */
public class Md5Util {
    private static final int ENCRYPT_NUMBER = 3;

    public static String getPassword(String text, String salt) {
        String md5 = "";
        for (int i = 0; i < ENCRYPT_NUMBER; i++) {
            md5 = DigestUtils.md5DigestAsHex((md5 + text + salt).getBytes());
        }
        return md5;
    }
}
